<?php	
	if($user->access==2){
?>
	<div id="infouser">
	<div id="modifuser">
		<form action="indexpopup.php?page=admin_user&idmodifuser=<?php  print $_GET['idmodifuser'] ; ?>" method="post">
		<table>
		<caption>Modif Users</caption>
		<?php
		$sql_query=mysql_query("Select email,login,access,id from ".DATABASE_TABLE_USER." WHERE id = '".mysql_escape_string($_GET['idmodifuser'])."' ");
		while ($query = mysql_fetch_array($sql_query) ){
		?>
			<tr>
				<td>Pseudo</td>
				<td><input type="text" name="mpseudo" value="<?php print $query['login'] ?>" /></td>
			</tr>
			<tr>
				<td>Access Level</td>
<!--				<td><input type="text" name="maccesslevel" value="<?php print $query['access'] ?>" /></td>-->
				<td>
					<select name="maccesslevel">
						<option value="2" <?php if($query['access']==2)print "selected=\"selected\"";?> >Admin</option>
						<option value="1" <?php if($query['access']==1)print "selected=\"selected\"";?>>User</option>
						<option value="0" <?php if($query['access']==0)print "selected=\"selected\"";?>>Bloked</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>New Password</td>
				<td><input type="password" name="mpasswd1" value="" /></td>
			</tr>
			<tr>
				<td>Retype Password</td>
				<td><input type="password" name="mpasswd2" value="" /></td>
			</tr>
			<tr>
				<td>Email</td>
				<td><input type="text" name="memail" value="<?php print $query['email'] ?>" /></td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="hidden" name="mid" value="<?php print $query['id'] ?>" />
					<input type="submit" value="change" />
					<input type="button" value="exit" onclick="reload_page('admin');" />
				</td>
			</tr>
		<?php 
		}
	?>
		</table>
		</form>
	</div>
	<div id="loguser">
		<table>
		<caption>Log User</caption>
		<tr>
			<td class="title">Action</td>
			<td class="title">Date</td>
		</tr>
		<?php
		$sql_query=mysql_query("Select action,date from ".DATABASE_TABLE_LOG." WHERE user = '".mysql_escape_string($_GET['modifuser'])."' ORDER BY date DESC LIMIT 10");
		while ($query = mysql_fetch_array($sql_query) ){
		?>
			<tr>
				<td><?php print $query['action']?></td>
				<td><?php print date("d/m/y à G\h i\m",$query['date']); ?></td>
			</tr>
		<?php 
		}
	?>
		</table>
	</div>	
	</div>
	<?php
}
?>